package de.openlaboratory.elib.controller.library;

import java.io.IOException;
import java.util.ArrayList;
import java.util.List;

import javax.servlet.ServletConfig;
import javax.servlet.ServletException;
import javax.servlet.ServletRequest;
import javax.servlet.ServletResponse;

import de.openlaboratory.elib.controller.AuthorDAO;
import de.openlaboratory.elib.controller.ElibService;
import de.openlaboratory.elib.model.library.Author;
import de.openlaboratory.elib.utilities.Operation;

public class AuthorFacade implements ElibService
{
	@Override
	public List<Author> execute(Operation operation, Object obj)
	{		
		List<Author> authors = new ArrayList<Author>();
		AuthorDAO dao = new AuthorDAO();
		
		switch (operation)
		{
			case LISTALL:
				authors = dao.findAll();
				break;
			default:
				break;
		}

		return authors;
	}

	@Override
	public String getName() {
		// TODO Auto-generated method stub
		return "Publication Service Facade";
	}

	@Override
	public List<?> execute(String command, Object obj) {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public void destroy() {
		// TODO Auto-generated method stub
		
	}

	@Override
	public ServletConfig getServletConfig() {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public String getServletInfo() {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public void init(ServletConfig arg0) throws ServletException {
		// TODO Auto-generated method stub
		
	}

	@Override
	public void service(ServletRequest arg0, ServletResponse arg1)
			throws ServletException, IOException {
		// TODO Auto-generated method stub
		
	}
}
